home *** CD-ROM | disk | FTP | other *** search
- From: _GOYRA_@msn.com (David Byrden)
- Subject: RE: Compiler unable to comprehend template for "<<" operator. What's wrong???
- Date: 15 Mar 96 04:50:34 -0800
- References: <4hto1l$bvl@newshost.lanl.gov>
- Message-ID: <00001a81+0000ad52@msn.com>
- Path: news.msn.com!msn.com
- Newsgroups: comp.lang.c++
- Organization: The Microsoft Network (msn.com)
-
-
- Martin;
-
-
- >> template<class Type>
- class vector {
- Type *v;
- int size;
- friend ostream &operator<<(ostream &, vector<Type> &);
- };
-
- template<class Type>
- ostream &operator<<(ostream &ostr, vector<Type> &vec) {
- }
-
- >>Apparently the compiler doesn't know how to use the template for
- >>operator<< to instantiate the << operator for a vector<float>. WHAT'S
- >>WRONG HERE??? I've tried several minor variations to the above code,
-
-
- You're doing nothing wrong. Try writing the friend function inline
- within the class declaration?
-
- David
-